//
//  MainThemeCell.m
//  OnePiece
//
//  Created by lanou on 15/10/26.
//  Copyright © 2015年 李伟伟. All rights reserved.
//

#import "MainThemeCell.h"
#import <UIImageView+WebCache.h>


@implementation MainThemeCell


- (instancetype)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    
    if ( self) {
        _coverView = [[UIImageView alloc]initWithFrame:CGRectMake(0, 0, (SCREEN_WIDTH-60)/3, (SCREEN_WIDTH-60)/3)];
        _coverView.layer.masksToBounds = YES;
        _coverView.contentMode = UIViewContentModeScaleAspectFit;
        
        _titleLabel = [[UILabel alloc]initWithFrame:CGRectMake(0, (SCREEN_WIDTH-60)/3 , (SCREEN_WIDTH-60)/3, 20)];
        _titleLabel.font = [UIFont systemFontOfSize:14];
        _titleLabel.textAlignment = NSTextAlignmentCenter;
        
        _subTitleLabel = [[UILabel alloc]initWithFrame:CGRectMake(0, (SCREEN_WIDTH-60)/3 + 20, (SCREEN_WIDTH-60)/3, 10)];
        _subTitleLabel.font = [UIFont systemFontOfSize:10];
        _subTitleLabel.textAlignment = NSTextAlignmentCenter;
        _subTitleLabel.textColor = [UIColor grayColor];
        
        [self.contentView addSubview:_coverView];
        [self.contentView addSubview:_titleLabel];
        [self.contentView addSubview:_subTitleLabel];
        
        
    }
    
    return self;
    
}

- (void)setConfigureModel:(MainThemeModel *)configureModel
{
    _configureModel = configureModel;
    
    [_coverView sd_setImageWithURL:[NSURL URLWithString:configureModel.img_url]];
    _titleLabel.text = configureModel.title;
    _subTitleLabel.text = configureModel.sub_title;
    
        
    
}












- (void)awakeFromNib {
    // Initialization code
}
//
//- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
//    [super setSelected:selected animated:animated];
//
//    // Configure the view for the selected state
//}

@end
